$(document).ready(function(){
	
	$('select.styled').selectmenu();
	
	$('input[type="checkbox"]').each(function(){
		checkerToggle(this);
	});
	$('input[type="checkbox"]').change(function(){
		checkerToggle(this);
	});
	
	function checkerToggle(el) {
		if($(el).attr('checked')) {
			$(el).parent().addClass('checked');
		} else {
			$(el).parent().removeClass('checked');
		}
	}
	
	console.log($('#control-panel').length);
	
	if($('#control-panel').length != 0) {
		$('.scroll-pane').addClass('has-controls');
	}
	
	
	$('.scroll-pane').jScrollPane({
		verticalDragMinHeight: 30,
		verticalDragMaxHeight: 30
	});

	$('.scroll-pane').hover(function(){
		$('.jspVerticalBar').fadeIn(500);
	}, function(){
		$('.jspVerticalBar').fadeOut(500);
	});


	

});
